package service;

import android.os.AsyncTask;

import com.wq.cycling.DemoApplication;

import util.cache.VoiceLoader;

/**
 * 添加手表验证银行卡
 * String deviceid = urls[0]; 设备id
 * String username = urls[1]; 用户名
 * String idcard = urls[2]; 身份证号
 * String bankidcard = urls[3]; 银行卡号
 * String bankofdeposit = urls[4]; 银行卡开户行
 *
 * @author wangqi
 */
public class AsyncTaskForDown extends AsyncTask<String, Void, String> {


	public AsyncTaskForDown(Listener listener) {
		this.listener = listener;
	}

	protected String doInBackground(String... urls) {
		String path = urls[0];
		return new VoiceLoader(DemoApplication.context).getVoicePath(path);
	}

	@Override
	protected void onPostExecute(String filepath) {
		try {
			if(!isCancelled()) {
				listener.finish(filepath);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public interface Listener{
		void finish(String path);
	}
	public Listener listener;

}
